home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / scenarios / train / Train 03.scl < prev    next >
Encoding:
Text File  |  2005-11-28  |  6.6 KB  |  203 lines

  1. scenario = GetProperties()
  2. scenario.ScenarioType = 1
  3. scenario.Title = "sc_Train_03_00"
  4. scenario.Map = "Beotorum.dat"
  5. scenario.Description = "sc_Train_03_01"
  6. scenario.Picture = "Train 03.dds"
  7. scenario.iSortOrder = 6
  8.  
  9. scenario.vShowMessageBoxes[STDDT_AUTOFINISH_COMBAT] = false
  10. scenario.vShowMessageBoxes[STDDT_COMBAT_PHASE] = false
  11. scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_CAPITAL] = false
  12. scenario.vShowMessageBoxes[STDDT_YOU_CLEARED_TERRITORY] = false
  13. scenario.vShowMessageBoxes[STDDT_ENEMY_CLEARED_TERRITORY] = false
  14. scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_COUNTRY] = false
  15. scenario.vShowMessageBoxes[STDDT_ENEMY_CAPTURED_COUNTRY] = false
  16. scenario.vShowMessageBoxes[STDDT_INVADE_COUNTRY] = false
  17.  
  18. Player(PT_PLAYER, RACE_HUMANS)
  19. Player(PT_AI, RACE_ALIENS)
  20.  
  21. SetInitialCamera(0.502456, 0.000000, -0.864603, 0.000000, 0.724024, 0.546580, 0.420760, 0.000000,0.472574, -0.837407, 0.274633, 0.000000,151.452988, 361.779846, -609.496460, 1.000000)
  22.  
  23. function InitialMOB()
  24.     StartMOB(1)
  25.     
  26.     ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_02a")
  27.     SelectCountry(13)
  28.     ShowXBallon(51, -1, MBS_RIGHT, 390, 471, "sc_Train_03_02")
  29.     UnselectCountry(13)
  30.  
  31.     --FlyCamera(0.502456, 0.000000, -0.864603, 0.000000, 0.724025, 0.546580, 0.420760, 0.000000, 0.472574, -0.837407, 0.274632, 0.000000, 406.109009, 361.779846, -461.505310, 1.000000)
  32.         FlyCamera(0.393208, 0.000000, -0.919449, 0.000000, 0.917146, 0.070738, 0.392223, 0.000000,0.065040, -0.997495, 0.027815, 0.000000,616.987915, 411.910065, -355.193359, 1.000000)
  33.  
  34.     SelectCountry(14)
  35.     ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_03")
  36.     ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_04a")
  37.     UnselectCountry(14)
  38.  
  39.     ShowObject(ARROW, 1, 65280, 50, 50, 7, 11, 9, 9)
  40.     ShowObject(ARROW, 2, 65280, 30, 50, 7, 7, 9, 5)
  41.     ShowBallon(3, -1, MBS_RIGHT, 11, 7, "sc_Train_03_04")
  42.  
  43.     HideObject(1)
  44.     HideObject(2)
  45.  
  46.     FlyCamera(0.502456, 0.000000, -0.864603, 0.000000, 0.648178, 0.661797, 0.376683, 0.000000,0.572192, -0.749683, 0.332524, 0.000000,386.551910, 180.057861, -472.870697, 1.000000)
  47.     SelectUnit2(4098)
  48.     SelectUnit2(4099)
  49.     SelectUnit2(4100)
  50.     SelectUnit2(4101)
  51.     SelectUnit2(4102)
  52.     ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_05")
  53.     UnselectUnit(4098)
  54.     UnselectUnit(4099)
  55.     UnselectUnit(4100)
  56.     UnselectUnit(4101)
  57.     UnselectUnit(4102)
  58.  
  59.     FlyCamera(0.502456, 0.000000, -0.864603, 0.000000, 0.724025, 0.546580, 0.420760, 0.000000, 0.472574, -0.837407, 0.274632, 0.000000, 406.109009, 361.779846, -461.505310, 1.000000)
  60.     ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_06")
  61.     
  62.     FinishMOB()
  63. end
  64.  
  65. function OnHexClicked(x, y, clicked_unit, selected_unit, command)
  66.     if GetMoney(14, MONEY_GUERRILLA) > 0 and command == CMD_MOVE then
  67.         if GetType(selected_unit) == TANK then
  68.             local pos = GetPos(selected_unit)
  69.             if x ~= (pos.x + 1) or y ~= (pos.y - 1) then
  70.                 IncorrectAction("sc_Train_03_17")
  71.             end
  72.         end
  73.  
  74.         if selected_unit == 4102 then
  75.             if x < 6 then
  76.                 IncorrectAction("sc_Train_03_18")
  77.             end
  78.         end
  79.     end
  80. end
  81.  
  82. old_prompt = ""
  83.  
  84. local bCanEndPhase = false
  85.  
  86. function OnUpdate()
  87.     bCanEndPhase = false
  88.  
  89.     if not AllUnitsMovedAndFiredIfCould() then
  90.         if GetMoney(14, MONEY_GUERRILLA) > 0 then
  91.             if GetMP(4098) + GetMP(4099) + GetMP(4100) + GetMP(4101) > 0 then
  92.                 ShowPrompting("sc_Train_03_07")
  93.             elseif GetMP(4102) > 0 then
  94.                 ShowPrompting("sc_Train_03_08")
  95.             end
  96.         else
  97.             if GetAliveUnitsAmount(COLOR_RED) > 0 then
  98.                 ShowPrompting("sc_Train_03_09")
  99.             else
  100.                 ShowPrompting("sc_Train_03_10")
  101.             end
  102.         end
  103.     else
  104.         ShowPrompting("sc_Train_finish_phase")
  105.         bCanEndPhase = true
  106.     end
  107. end
  108.  
  109. local bJustInvaded14 = false
  110.  
  111. function OnEndTurn()
  112.     if IsInvaded(14) then
  113.         StartMOB(1)
  114.                 FlyCamera(-0.323464, 0.000000, 0.946240, 0.000000, -0.557854, 0.807733, -0.190698, 0.000000,-0.764310, -0.589548, -0.261273, 0.000000,874.347168, 246.382706, -199.597382, 1.000000)
  115.  
  116.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_11")
  117.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_11a")
  118.         ShowXBallon(51, -1, MBS_CENTER, 300, 320, "sc_Train_03_11b")
  119.         Money(14, MONEY_GUERRILLA, 0)
  120.         SetupUnit( 1, BUNKER, 9, 5 )
  121.         SetupUnit( 2, BUNKER, 9, 7 )
  122.         SetupUnit( 3, BUNKER, 9, 9 )
  123.         SetupUnit( 4, BUNKER, 10, 10 )
  124.         SetupUnit( 5, BUNKER, 10, 12 )
  125.         SetupUnit( 6, BUNKER, 10, 8 )
  126.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_12")
  127.         bJustInvaded14 = true
  128.         FinishMOB(1)
  129.     end
  130. end
  131.  
  132. function OnEndAITurn()
  133.     if bJustInvaded14 then
  134.         StartMOB(1)
  135.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_13a")
  136.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_13")
  137.         ShowXBallon(51, -1, MBS_CENTER, 300, 340, "sc_Train_03_13b")
  138.         bJustInvaded14 = false
  139.         FinishMOB(1)
  140.     end
  141. end
  142.  
  143. function OnUnitDead(unit)
  144.     if GetAliveUnitsAmount(COLOR_RED) == 0 and GetCapitalControl(14) == COLOR_RED then
  145.         StartMOB(1)
  146.         StoreCamera()
  147.         FlyCamera(-0.131823, 0.000000, -0.991273, 0.000000, 0.882500, 0.455435, -0.117358, 0.000000, 0.451461, -0.890269, -0.060037, 0.000000, 535.552368, 422.650391, -264.117493, 1.000000)
  148.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_14")
  149.         RestoreCamera()
  150.         FinishMOB()
  151.     end
  152. end
  153.  
  154. function OnCapitalCaptured(country, color)
  155.     if(country == 14 and color == COLOR_GREEN) then
  156.         if (GetAliveUnitsAmount(COLOR_RED) > 0) then
  157.             StartMOB(1)
  158.             StoreCamera()
  159.             FlyCamera(-0.974395, 0.000000, -0.224844, 0.000000, 0.211247, 0.342481, -0.915468, 0.000000, 0.077005, -0.939525, -0.333712, 0.000000, 622.301758, 361.820587, -132.521454, 1.000000)
  160.             ShowXBallon(51, -1, MBS_CENTER, 300, 320, "sc_Train_03_15")
  161.             FinishMOB()
  162.         end
  163.     end
  164. end
  165.  
  166. function OnCountryCaptured(country, color)
  167.     if(country == 14 and color == COLOR_GREEN) then
  168.         StartMOB(1)
  169.         ShowXBallon(51, -1, MBS_CENTER, 300, 400, "sc_Train_03_16")
  170.         ShowXBallon(51, -1, MBS_CENTER, 300, 400, "sc_Train_03_16a")
  171.         FinishMOB()
  172.     end
  173. end
  174.  
  175. function OnEndPhase( phase )
  176.     if GetTurnNumber( COLOR_GREEN ) == 0 and phase == PHASE_COMBAT then
  177.         if not bCanEndPhase then
  178.             IncorrectAction("sc_Train_01_05")
  179.         end
  180.     end
  181. end
  182.  
  183. function CheckForVictory()
  184.     if(GetCountryControl(14) == COLOR_GREEN) then return GAMERESULT_VICTORY end
  185.     if(GetCountryControl(14) == COLOR_RED) then return GAMERESULT_DEFEAT end
  186.     return GAMERESULT_NONE
  187. end
  188.  
  189. function InitialSetup()
  190.  
  191. Country(13, ALLIANCE_FNU_ALLY)
  192. Money(13, MONEY_TOTAL_REVENUE, 0)
  193. Country(14, ALLIANCE_NEUTRAL)
  194. Money(14, MONEY_GUERRILLA, 6)
  195. Money(14, MONEY_TOTAL_REVENUE, 0)
  196. SetupUnit(4098, TANK, 7, 7)
  197. SetupUnit(4099, TANK, 7, 9)
  198. SetupUnit(4100, TANK, 7, 11)
  199. SetupUnit(4101, TANK, 8, 12)
  200. SetupUnit(4102, HBOT, 6, 10)
  201.  
  202. end
  203.